package com.neoCalf.neoUser.config;

import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingFactory;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.api.naming.pojo.Instance;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @author 小牛
 * @version 1.0
 * @description TODO
 * @date 2025/4/17 18:57
 */
@Configuration
public class NaCosConfig {
    @Bean
    public NamingService namingService() {
        try {
            Properties properties = new Properties();
            properties.setProperty("serverAddr", "http://localhost:8848");
            return NamingFactory.createNamingService(properties);
        } catch (NacosException e) {
            throw new RuntimeException(e);
        }
    }
}
